#include "InputStateManager.h"
#include "InputState.h"

InputStateManager::InputStateManager() : 
	m_LMBPressed(false),
	m_RMBPressed(false),
	m_WheelPos(0)
{
	m_oldMousePos.x = 0;
	m_oldMousePos.y = 0;
	m_MousePos = m_oldMousePos;
}

InputStateManager::~InputStateManager()
{
	
}

InputState InputStateManager::GenerateInputState()
{
	POINTS mouseDeltaPos;
	mouseDeltaPos.x = m_MousePos.x - m_oldMousePos.x;
	mouseDeltaPos.y = m_MousePos.y - m_oldMousePos.y;
	m_oldMousePos = m_MousePos;

	bool b = GetKeyboardState(m_Keys);

	InputState inputState(m_LMBPressed, m_RMBPressed, m_WheelPos, mouseDeltaPos, m_MousePos, m_Keys, 0.1f);
	m_WheelPos = 0;
	
	return inputState;
}

void InputStateManager::setMousePos(POINTS pos)
{
	m_MousePos = pos;
}

void InputStateManager::setLMBPressed(bool pressed)
{
	m_LMBPressed = pressed;
}

void InputStateManager::setRMBPressed(bool pressed)
{
	m_RMBPressed = pressed;
}

void InputStateManager::setWheelPos(short pos)
{
	m_WheelPos = pos;
}